#!/usr/bin/env bash

#
# Updates all *.expected.out files it finds within tests/lean
#

find "$(dirname "$0")" -name '*.expected.out' |
while read -r to; do
  from="${to/.expected.out/.produced.out}"
  [ ! -f "$from" ] || cmp -s "$from" "$to" || cp -v "$from" "$to"
done
